import os

import pymysql
from sqlalchemy import create_engine

pymysql.install_as_MySQLdb()
SECRET_KEY = 'a2bgx2*)^m)#k+b_!3v-v1(gkec_yser)0cudij)*#^+f_gx*%'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True


# 创建 MySQL 数据库连接
# 替换以下信息：用户名、密码、数据库名、主机地址
username = 'root'
password = 'd752dgzbST1jq5lpJtYSyHh6DSY0'
database = 'trade'
host =  '150.158.127.55'  # 或者你的 MySQL 主机地址
port = '3306'
# 创建连接字符串
connection_string = f'mysql+pymysql://{username}:{password}@{host}:{port}/{database}'
conn = create_engine(connection_string)


INSTALLED_APPS = [
    'mysite.lqcon',
]


# 线上cms环境
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
        },
        'NAME': database,
        'USER': username,
        'PASSWORD': password,
        'HOST': host,
    }
}



LANGUAGE_CODE = 'zh-hans'

TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True

USE_L10N = True

USE_TZ = False
